Thermonuclear explosions on surfaces of neutron star and white dwarfs